<template>
    <div class="square-container">
        <div class="square-header">
            <img src="@/assets/images/AI.png" width="30px" height="30px" />
            <span class="square-title">AI广场</span>
        </div>
        <div class="card-container">
            <div v-for="(item, index) in cardList" :key="index" class="el-card">
                <div class="card-content">
                    <div class="card-title">{{ item.title }}</div>
                    <div class="card-desc">{{ item.desc || '暂无描述信息' }}</div>
                    <div class="card-btn">
                        <el-button round>{{ item.btn }}</el-button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'

const cardList = ref([
    {
        title: "合同对比",
        desc: "可以识别新增、删除和修改的内容，并以直观的方式展示这些变化。",
        router: '',
        btn: '立即使用',
    },
    {
        title: "邮件生成",
        desc: "能够快速的帮您生成您想要的邮~",
        router: '',
        btn: '立即使用',
    },
    {
        title: "商讯侦探",
        desc: "",
        router: '',
        btn: '立即使用',
    },
])
</script>

<style lang="scss" scoped>
.square-container {
    width: 93.5vw;
    height: 95vh;
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 2.5vh 24px 2.5vh 0;
    margin-left: 5%;
    border-radius: 14px;
    background: #f3f9ff;
}

.square-header {
    display: flex;
    align-items: center;
    height: 40px;
    margin: 20px;
}

.square-header img {
    margin-right: 10px;
}

.square-title {
    font-size: 20px;
    font-weight: 500;
}

.el-card {
    background-color: #fff;
    width: 240px;
    height: 240px;
    margin: 5px;
    display: flex;
    justify-content: center;
    align-items: stretch;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
}

.card-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.card-desc {
    flex-grow: 1;
    font-size: 12px;
    color: #999999;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* 设置显示的最大行数 */
    -webkit-box-orient: vertical;
}

.card-btn {
    display: flex;
    justify-content: center;
    align-items: center;

    button {
        padding: 15px 30px;
        background-color: #409eff;

    }
}

.card-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 20px;
    gap: 16px;
    /* 添加间距 */
}
</style>